<?php
defined('_JEXEC') or die;

// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if(isDevMode()) {
   OCP\Util::addStyle('jobposition', 'jobposition');
   OCP\Util::addStyle('interview', 'interview');
   OCP\Util::addScript('jobposition', 'preview');
} else {
   OCP\Util::addStyle('static', 'jobposition');
   OCP\Util::addStyle('static', 'interview');
   OCP\Util::addScript('static', 'apps/jobpos.preview.min');
}
OCP\App::setActiveNavigationEntry('jobpos_index');
?>
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('jobposition/js', 'jobposition.php'));?>"></script>

<div class="hr_inner_navigate clearfix">
   <div class="hr_breadcrumbs">当前位置：<a href="<?php echo OCP\Util::linkToRoute("jobpos_index");?>">职位管理</a> &gt; 
      <a href="<?php echo OC_Helper::linkToRoute("jobpos_setup", array('id'=>$_['jobdetails']->id, 'job_title'=>$_['jobdetails']->job_title)); ?>#interview"><?=$_['jobdetails']->job_title?></a> &gt; <?=$_['sheetdetails']->title?>
   </div>
</div>

<div class="hr_position_set hr_position_set_inner">

   <div class="container inner_wrap">
      <div class="container" id="will_fixed">
         <div class="row-fluid">
            <div class="span12">
               <div class="company_qes_fixed clearfix"><?php echo $_['user']->name.'-'.$_['jobdetails']->job_title.'线上笔试'; ?><br/><span>(线上笔试共<?php echo $_['sheetdetails']->questioncount; ?>题,笔试时间<?php echo $_['sheetdetails']->totaltime; ?>分钟)</span></div>
            </div>
         </div>
      </div>

      <div class="row-fluid hr_oneconn_margin">
         <div class="span12 oneconn_box">
            <div class="lgrg_form">
               <div id="exam_container" class="exam_container">
               <?php foreach ($_['exampaper'] as $k => $v):?>
               <?php
               if (!is_int($k))
                  continue;
               $op_label = array('A','B','C','D','E','F','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
               switch ($v->type) {
                  case 'singleanswer':
                     ?>
                     <div class="test_questionbox">
                        <h6><?=$k+1?>. <? echo $v->question_img ? "<img src='".$v->question_img."'>" : $v->question;?></h6>
                        <div class="test_question_select normal">
                           <?php foreach ($v->answer as $key => $choice):?>
                           <label class="radio">
                              <input type="radio" class="each_answer" name="<?=$v->questionid?>" value="<?=$key+1?>"/>
                              <?=$op_label[$key]?>. <?php echo htmlspecialchars($choice->choice);?>
                           </label>
                           <?php endforeach;?>
                        </div>
                     </div>
                     <?php
                     break;
                  case 'multipleanswer':
                     ?>
                     <div class="test_questionbox">
                        <h6><?=$k+1?>. <? echo $v->question_img ? "<img src='".$v->question_img."'>" : $v->question;?></h6>
                        <div class="test_question_select normal">
                           <?php foreach ($v->answer as $key => $choice):?>
                           <label class="checkbox">
                              <input type="checkbox" class="each_answer" name="<?=$v->questionid?>" value="<?=$key+1?>"/>
                              <?=$op_label[$key]?>. <?php echo htmlspecialchars($choice->choice);?>
                           </label>
                           <?php endforeach;?>
                        </div>
                     </div>
                     <?php
                     break;
                  case 'freeinput':
                     ?>
                     <div class="test_questionbox">
                        <h6><?=$k+1?>. <? echo $v->question_img ? "<img src='".$v->question_img."'>" : $v->question;?></h6>
                        <div class="test_question_textarea normal">
                           <textarea name="<?=$v->questionid?>" class="each_answer"></textarea>
                        </div>
                     </div>
                     <?php
                     break;
                  // make default to singleanswer
                  default:
                     ?>
                     <div class="test_questionbox">
                        <h6><?=$k+1?>. <? echo $v->question_img ? "<img src='".$v->question_img."'>" : $v->question;?></h6>
                        <div class="test_question_select normal">
                           <?php foreach ($v->answer as $key => $choice):?>
                           <label class="radio">
                              <input type="radio" class="each_answer" name="<?=$v->questionid?>" value="<?=$key+1?>"/>
                              <?=$op_label[$key]?>. <?php echo htmlspecialchars($choice->choice);?>
                           </label>
                           <?php endforeach;?>
                        </div>
                     </div>
                     <?php
                     break;
               }
               ?>
               <?php endforeach;?>
               </div>

               <div class="loadmorequstion yahei" id="loadmorequstion" style="display:none;">加载更多试题</div>

               <div id="last_end" style="display:none;"><?=$_['exampaper']['last_end'];?></div>
               <div id="total_num" style="display:none;"><?php echo $_['sheetdetails']->questioncount; ?></div>
               <div id="sheetid" style="display:none;"><?=$_['sheetdetails']->id?></div>

            </div>
         </div>
      </div>
   </div>

</div>
